Conversation
| expected_output = [{"app_name" => "android2csv", "action_greetings" => "Hello", "ANOTHER_STRING" => "testEN", "empty" => ""}, | ||
| {"app_name" => "This is the app name", "action_greetings" => "This is a greeting", | ||
| "ANOTHER_STRING" => "This is another string", "empty" => "This is an empty string"}] | ||
| output = Babelish::Android2CSV.new.load_strings "test/data/android-comments.xml" |
There was a problem hiding this comment.
Line is too long. [84/80]
test/babelish/test_android2csv.rb
Outdated
| def test_load_strings_with_comments | ||
| expected_output = [{"app_name" => "android2csv", "action_greetings" => "Hello", "ANOTHER_STRING" => "testEN", "empty" => ""}, | ||
| {"app_name" => "This is the app name", "action_greetings" => "This is a greeting", | ||
| "ANOTHER_STRING" => "This is another string", "empty" => "This is an empty string"}] |
There was a problem hiding this comment.
Align the elements of a hash literal if they span more than one line.
Line is too long. [92/80]
Space inside } missing.
test/babelish/test_android2csv.rb
Outdated
|
|
||
| def test_load_strings_with_comments | ||
| expected_output = [{"app_name" => "android2csv", "action_greetings" => "Hello", "ANOTHER_STRING" => "testEN", "empty" => ""}, | ||
| {"app_name" => "This is the app name", "action_greetings" => "This is a greeting", |
There was a problem hiding this comment.
Align the elements of an array literal if they span more than one line.
Space inside { missing.
Line is too long. [89/80]
Trailing whitespace detected.
test/babelish/test_android2csv.rb
Outdated
| end | ||
|
|
||
| def test_load_strings_with_comments | ||
| expected_output = [{"app_name" => "android2csv", "action_greetings" => "Hello", "ANOTHER_STRING" => "testEN", "empty" => ""}, |
There was a problem hiding this comment.
Space inside { missing.
Line is too long. [130/80]
Space inside } missing.
Trailing whitespace detected.
| comments[node["name"]] = previous_comment if previous_comment | ||
| previous_comment = nil | ||
| end | ||
| if node.comment? |
There was a problem hiding this comment.
Use next to skip iteration.
| def parse_comment_line(line) | ||
| line.strip! | ||
| if line[0] != ?# && line[0] != ?= | ||
| m = line.match(/^\/\*(.*)\*\/\s*$/) |
There was a problem hiding this comment.
Use %r around regular expression.
There was a problem hiding this comment.
@netbe This function I copied from strings2csv.rb, so unsure if I should still change this according to houndci-bot.
There was a problem hiding this comment.
@Dchau95 yes please make any change @houndci-bot mention and add tests to check comments on android
|
|
||
| def parse_comment_line(line) | ||
| line.strip! | ||
| if line[0] != ?# && line[0] != ?= |
There was a problem hiding this comment.
Do not use the character literal - use string literal instead.
| "empty" => "This is an empty string" | ||
| } | ||
| ] | ||
| output = Babelish::Android2CSV.new.load_strings "test/data/android-comments.xml" |
There was a problem hiding this comment.
Line is too long. [84/80]
test/babelish/test_android2csv.rb
Outdated
| "ANOTHER_STRING" => "This is another string", | ||
| "empty" => "This is an empty string" | ||
| } | ||
| ] |
There was a problem hiding this comment.
Indent the right bracket the same as the start of the line where the left bracket is.
test/babelish/test_android2csv.rb
Outdated
| "action_greetings" => "This is a greeting", | ||
| "ANOTHER_STRING" => "This is another string", | ||
| "empty" => "This is an empty string" | ||
| } |
There was a problem hiding this comment.
Indent the right brace the same as the start of the line where the left brace is.
test/babelish/test_android2csv.rb
Outdated
| "app_name" => "This is the app name", | ||
| "action_greetings" => "This is a greeting", | ||
| "ANOTHER_STRING" => "This is another string", | ||
| "empty" => "This is an empty string" |
There was a problem hiding this comment.
Trailing whitespace detected.
test/babelish/test_android2csv.rb
Outdated
| { | ||
| "app_name" => "This is the app name", | ||
| "action_greetings" => "This is a greeting", | ||
| "ANOTHER_STRING" => "This is another string", |
There was a problem hiding this comment.
Trailing whitespace detected.
test/babelish/test_android2csv.rb
Outdated
| "action_greetings" => "Hello", | ||
| "ANOTHER_STRING" => "testEN", | ||
| "empty" => "" | ||
| }, |
There was a problem hiding this comment.
Indent the right brace the same as the start of the line where the left brace is.
Trailing whitespace detected.
| "app_name" => "android2csv", | ||
| "action_greetings" => "Hello", | ||
| "ANOTHER_STRING" => "testEN", | ||
| "empty" => "" |
There was a problem hiding this comment.
Trailing whitespace detected.
test/babelish/test_android2csv.rb
Outdated
| { | ||
| "app_name" => "android2csv", | ||
| "action_greetings" => "Hello", | ||
| "ANOTHER_STRING" => "testEN", |
There was a problem hiding this comment.
Trailing whitespace detected.
test/babelish/test_android2csv.rb
Outdated
| expected_output = [ | ||
| { | ||
| "app_name" => "android2csv", | ||
| "action_greetings" => "Hello", |
There was a problem hiding this comment.
Trailing whitespace detected.
test/babelish/test_android2csv.rb
Outdated
| def test_load_strings_with_comments | ||
| expected_output = [ | ||
| { | ||
| "app_name" => "android2csv", |
There was a problem hiding this comment.
Trailing whitespace detected.
|
@Dchau95 Thks for the contrib, just getting back from vacation, I ll have a look soon |
Android XML load strings does not load comments, whereas iOS Strings loads comments. Merely trying to mirror both platform strings conversion.